<%@page import="com.mmy.domain.sys.TSysUser"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	TSysUser tSysUser = (TSysUser) session.getAttribute("tSysUser");
%>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="js/vue/vue.js"></script>
<script src="js/axios.min.js"></script>
<script src="js/vue/eleme.js"></script>
<link rel="stylesheet" type="text/css" href="css/eleme.css"/>
<style>
    [v-cloak] {
        display: none !important;
    }
    .logging{
        float: right;
        margin: 55px;
    }
    .logo{
        float: left;
        width: 300px;
        margin: 20px;
    }
    .top{
        height: 135px;
    }
</style>
</head>
<body>
    <div id="frontHead" v-cloak>
        <header>
            <div class="top">
                <!-- 左logo -->
                <div class="logo">
                        <a href="/mmy/" id="logo"> 
                            <img class="logo" src="img/页眉LOGO.png" alt="Mmy Html Theme" />
                        </a>
                </div>

                <!-- 右登录 -->
                <div class="logging">
                    <c:choose>
                        <c:when test="${tSysUser != null}">
                            <el-dropdown>
                                <span class="el-dropdown-link">
                                    ${tSysUser.getUserAccount()}
                                <i class="el-icon-arrow-down el-icon--right"></i>
                                </span>
                                <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item><a href="perinfo">个人信息</a></el-dropdown-item>
                                <el-dropdown-item><a href="toupdatepassword">修改密码</a></el-dropdown-item>
                                <el-dropdown-item><a href="myscenicreserve">购物车</a></el-dropdown-item>
                                <el-dropdown-item><a href="logout">退出登录</a></el-dropdown-item>
                                </el-dropdown-menu>
                            </el-dropdown>
                        </c:when>
                        <c:otherwise>
                            登录 注册
                        </c:otherwise>
                    </c:choose>
                </div>
            </div>
            <!-- 导航栏 -->
            <div class="index-menu cbp-af-header">
                <div class="container">
                    <div class="wrap">
                        <nav id="nav">
                            <ul class="nav" id="parUL">
                                <li class="nav-item" v-for="menu in menus">
                                    <a :href="menu.url">{{menu.menuName}}</a>
                                </li>
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>
        </header>
    </div>
</body>
<script>
    const vm = new Vue({
        el:"#frontHead",
        data(){
            return{
                menus:[],
            }
        },
        created(){
            axios.get('loadfrontmenu')
            .then(res => this.menus = res.data.menu)
            .catch(error =>console.log(error))
        },
        methods:{
            
        }

    })
</script>
</html>